/******************************************************************************
 * Copyright (C) 2016  671643387@qq.com
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 *****************************************************************************/

#ifndef NODE_SYSTEM_MUTEX_H_
#define NODE_SYSTEM_MUTEX_H_

#include <node/platform.h>
#if defined(PLATFORM_LINUX)
#include <node/system/mutex_POSIX.h>
#elif defined(PLATFORM_WINDOWS)
#include <node/system/mutex_WIN32.h>
#endif

namespace node {
	namespace system {

	class mutex : private mutex_impl
	{
	public:
		mutex(void) : mutex_impl() {}
		~mutex(void) {}

		bool lock(void) { return lock_impl(); }
		bool trylock(void) { return trylock_impl(); }
		void unlock(void) { unlock_impl(); }
	};

}}

#endif // NODE_SYSTEM_MUTEX_H_
